#include <iostream>
#define swap(a, b) {int tmp=a; a=b; b=tmp;}
using namespace std;
void selection_sort(int* arr, int size){
for(int i=0; i<size; ++i){
int ind=i;
for(int j=i; j<size; ++j){
if(arr[ind]>arr[j]) ind=j;
}
swap(arr[i], arr[ind]);
}
}
int main(void){
int arr[]={5, 2, 4, 6, 1, 3};
int size=sizeof(arr)/sizeof(int);
selection_sort(arr, size);
for(int i=0; i<size-1; ++i){
cout<<arr[i]<<", ";
}
cout<<arr[size-1]<<endl;
}